<template>
  <div>
      <van-nav-bar
         left-arrow
        class="app-nav-bar"
        title="请假详情页"
        @click-left="$router.back()"
      />
      <van-cell-group>
        <van-cell title="学号:" :value="tableData.studentNo" />
        <van-cell title="班级:" :value="tableData.className" />
        <van-cell title="学生姓名:" :value="tableData.studentName" />
        <van-cell title="请假类型:">
             <template #default>
                <span style="margin-left:10px" v-if="tableData.leaveType === '1'">事假</span>
                  <span style="margin-left:10px" v-if="tableData.leaveType === '2'">病假</span>
            </template>
        </van-cell>
        <van-cell title="请假日期:" :value="tableData.leaveDate" />
        <van-cell title="请假原因:" :value="tableData.leaveReason" />
        <van-cell title="处理状态:">
            <template #default>
                
                  <span style="margin-left:10px" v-if="tableData.status === '0'">正常</span>
                  <span style="margin-left:10px" v-if="tableData.status === '1'">请假</span>
                  <span style="margin-left:10px" v-if="tableData.status === '2'">家长确认通过</span>
                  <span style="margin-left:10px" v-if="tableData.status === '3'">班主任审核通过</span>
            </template>
        </van-cell>
        <van-cell title="家长描述信息:" :value="tableData.parentDesc" />
        <van-cell title="班主任描述信息:" :value="tableData.teacherDesc" />
        <van-cell title="提交时间:" :value="tableData.modifyTime" />
        
      </van-cell-group>
  </div>
</template>

<script>
export default {
    data(){
        return{
            tableData:[],
        }
    },
    methods:{
        async select(){
            var {data:res} = await this.$axios({
                url:this.$location.getLeaveById,
                params:{
                    id:this.$route.params.id
                }
            })
            // console.log(res.data);
            this.tableData = res.data;
        }
    },
    created(){
        this.select();
    }
}
</script>

<style lang="less" scoped>
    /deep/ .app-nav-bar{
        background-color: #35d299;
        .van-nav-bar__title{
            color: #fff;
        }
        .van-icon{
            color: #fff;
            
        }
    }
</style>